import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../views/back/Index";
import Api from "../views/back/system/Api";
import Role from "../views/back/system/Role";
import Permission from "../views/back/system/Permission";
import Login from "../views/auth/Login";
import CodeBuilder from "../views/back/system/CodeBuilder";
import User from "../views/back/system/User";
import UserRole from "../views/back/system/UserRole";
import Swagger from "../views/back/system/Swagger";
import Error404 from "../views/error/Error404";
import Menu from "../views/back/system/Menu";
import Dictionary from "../views/back/system/Dictionary";
import DictionaryGroup from "../views/back/system/DictionaryGroup";
import RoleMenu from "../views/back/system/RoleMenu";
import Person from "../views/back/system/Person";
import ChangePwd from "../views/back/system/ChangePwd";

Vue.use(VueRouter);

const routes = [



  {
    path: '/swagger',
    name: 'Swagger',
    component: Swagger
  },
  {
    path: '/login',
    name: '欢迎登录',
    component: Login
  },
  {
    path: '/',
    name: '首页',
    component: Index,
    children: [

      {
        path: 'api',
        name: '接口同步',
        component: Api
      },
      {
        path: 'sysRole',
        name: '角色管理',
        component: Role
      },
      {
        path: 'sysPermission',
        name: '权限管理',
        component: Permission
      },
      {
        path: 'codeBuilder',
        name: '代码生成',
        component: CodeBuilder
      },
      {
        path: 'sysUser',
        name: '用户管理',
        component: User
      },
      {
        path: 'sysUserRole',
        name: '分配角色',
        component: UserRole
      },
      {
        path: 'sysMenu',
        name: '菜单管理',
        component: Menu
      },
      {
        path: 'sysDictionary',
        name: '数据字典',
        component: Dictionary
      },
      {
        path: 'sysDictionaryGroup',
        name: '字典详情',
        component: DictionaryGroup
      },
      {
        path: 'sysRoleMenu',
        name: '分配菜单',
        component: RoleMenu
      },
      {
        path: 'person',
        name: '个人中心',
        component: Person
      },
      {
        path: 'changePwd',
        name: '修改密码',
        component: ChangePwd
      }
    ]
  },
  {
    path: '*',
    name: '404错误页面',
    component: Error404
  }
];

const router = new VueRouter({
  routes
});

export default router
